import { GetTreeList, GetTreeData } from '@/services/category';
const CategoryModel = {
    namespace: 'Category',
    state: {
        response: {},
    },
    effects: {

        * getTreeList({ payload }, { call, put }) {
            const response = yield call(GetTreeList, payload);
            yield put({
                type: 'deal',
                payload: response,
            });
        },

        * getTreeData({ payload }, { call, put }) {
            const response = yield call(GetTreeData, payload);
            yield put({
                type: 'deal',
                payload: response,
            });
        },
    },
    reducers: {
        deal(state, action) {
            return { ...state, response: action.payload };
        },
    },
};
export default CategoryModel;